#!/bin/sh

. scripts/functions

URL=http://$WIN32_ADDR:8091
wget -qO $tmp/start.log "$URL/reboot"

# we need a way to start the regress-win32.pl at the start
while ! ping -c 1 $WIN32_ADDR > /dev/null; do
    sleep 5
done
echo "Machine $URL supposedly rebooted"

echo "If the autologon doesn't work, you can double click on c:\\autologon.reg"
i=0
while ! wget -qO /dev/null $URL/nop; do
    sleep 5
    i=`expr $i + 1`
    if [ $i -ge 12 ]; then  # print message every minute
       i=0
       echo "== `date +%T` Waiting for reboot and autologin to $URL, you can also login and start regress-win32.pl by hand"
    fi
done
